﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ServiceLocator.cs" company="">
//   
// </copyright>
// <summary>
//   The service locator.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace TinyRadio.UserInterface.Infrastructure
{
    using System.ComponentModel;
    using System.Windows;

    using TinyRadio.UserInterface.Models;
    using TinyRadio.UserInterface.Services;
    using TinyRadio.UserInterface.ViewModels;

    /// <summary>The service locator.</summary>
    public class ServiceLocator
    {
        #region Public Properties

        /// <summary>Gets the radio player view model.</summary>
        public static RadioPlayerViewModel RadioPlayerViewModel
        {
            get
            {
                var radioPlayer = new RadioPlayer();

                IRadioStationService radioStationService = DesignerProperties.GetIsInDesignMode(new DependencyObject())
                                                               ? (IRadioStationService)new RadioStationServiceMock()
                                                               : new RadioStationService();

                var userSettings = new UserSettings();

                return new RadioPlayerViewModel(userSettings, radioPlayer, radioStationService);
            }
        }

        #endregion
    }
}